import axios from 'axios'

const http = (url, params, func, config) => {

  var form = new FormData()
  for(var i in params) {
    form.append(i, params[i])
  }
  axios({
    method: 'post',
    url: url,
    headers: {
      'Content-type': 'application/x-www-form-urlencoded'
    },
    data: form,
  }).then((res) => {
    func(res.data)
  })
}

export default http
